package com.maila.xiaoaoschool.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.maila.xiaoaoschool.R;
import com.maila.xiaoaoschool.widget.CircleImageView;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;
import com.zhy.autolayout.utils.AutoUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 评论adapter
 * Created by Administrator on 2017/9/26.
 */

public class CommentAdapter extends BaseAdapter {
    Context context;

    public CommentAdapter(Context context) {
        this.context = context;
    }

    @Override
    public int getCount() {
        return 6;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder holder = null;
        if (view == null) {
            view = LayoutInflater.from(context).inflate(R.layout.item_comment, viewGroup, false);
            holder = new ViewHolder(view);
            view.setTag(holder);
            AutoUtils.autoSize(view);
        } else {
            holder = (ViewHolder) view.getTag();
        }
        return view;
    }


    static class ViewHolder {
        @BindView(R.id.iv_header)
        CircleImageView ivHeader;
        @BindView(R.id.tv_name)
        TextView tvName;
        @BindView(R.id.tv_time)
        TextView tvTime;
        @BindView(R.id.user_info)
        AutoRelativeLayout userInfo;
        @BindView(R.id.iv_photo_1)
        ImageView ivPhoto1;
        @BindView(R.id.iv_photo_2)
        ImageView ivPhoto2;
        @BindView(R.id.iv_photo_3)
        ImageView ivPhoto3;
        @BindView(R.id.all_photo)
        AutoLinearLayout allPhoto;
        @BindView(R.id.tv_com_peisong)
        TextView tvComPeisong;
        @BindView(R.id.tv_com_shangpin)
        TextView tvComShangpin;
        @BindView(R.id.tv_reviews)
        TextView tvReviews;
        @BindView(R.id.tv_foodinfo)
        TextView tvFoodinfo;
        @BindView(R.id.ll_content)
        AutoLinearLayout llContent;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
